/**
 * 用户相关的请求模块
 */
import request from '@/utils/request'
// import store from '@/store'
/**
 * 商品列表
 */
export const product = data => {
  return request.get('goods', data)
}
/**
 * 商品详情
 */
export const productt = data => {
  return request.get(`goods/${data}`)
}
/**
 * 商品新增
 */
export const newly = data => {
  return request.post('goods', data)
}
/**
 * 删除商品
 */
export const deleteid = data => {
  return request.delete(`goods/${data}`)
}
/**
 * 商品类别增加
 */
export const category = data => {
  return request.post('goods-type', data)
}
/**
 * 商品类别增加
 */
export const Thequery = () => {
  return request.get('goods-type')
}
/**
 * 商品类别删除
 */
export const goodsdelete = data => {
  return request.delete(`goods-type/${data}`)
}
/**
 * 子类别增加
 */
export const subcategory = data => {
  return request.post('goods-type-child', data)
}
/**
 * 商品类别id查询
 */
export const goodsModifythe = data => {
  return request.get(`goods-type/${data}`)
}
/**
 * 商品类别查询
 */
export const goodsModifythee = () => {
  return request.get('goods-type')
}
/**
 * 商品类别修改
 */
export const goodschange = (data, da) => {
  return request.put(`goods-type/${data}`, da)
}
/**
 * 商品列表修改
 */
export const goodsListamend = (data, da) => {
  return request.put(`goods/${data}`, da)
}
/**
 * 子类别查询
 */
export const childClass = data => {
  return request.get(`goods/${data}/child`)
}
/**
 * 子类别新增
 */
export const addsubclass = (data) => {
  return request.post('goods-type-child', data)
}
/**
 * 子类别修改
 */
export const compilesubclass = (data, da) => {
  return request.put(`goods-type-child/${data}`, da)
}
/**
 * 子类别获取id
 */
export const compid = data => {
  return request.get(`goods-type-child/${data}`)
}
/**
 * 子类别删除
 */
export const compdelete = data => {
  return request.delete(`goods-type-child/${data}`)
}
